package wevil.spring.daomysql.impl;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import wevil.spring.daomysql.sys_configDao;
import wevil.spring.domainmysql.sys_config;

import javax.annotation.Resource;
import java.util.List;

@Repository
@Transactional
public class sys_configDaoImpl implements sys_configDao {
    @Resource
    private SessionFactory sessionFactory;


    public Session getSession() {
        return sessionFactory.openSession();
    }


    public List<sys_config> queryAll() {
        return getSession().createQuery("FROM " + sys_config.class.getSimpleName()).list();

    }
}
